from django.contrib import admin
from .models import Post, Comment

class PostAdmin(admin.ModelAdmin):
    prepopulated_fields = {'slug': ('title',)}
    list_display = ('title', 'publish_date', 'status', 'image')
    list_filter = ('publish_date', 'status',)
    search_fields = ['title']

admin.site.register(Post, PostAdmin)


class CommentAdmin(admin.ModelAdmin):
    display_fields = ['post', 'author', 'created']   

admin.site.register(Comment, CommentAdmin)